<template>
  <div class="contain">
    <!-- 顶部导航栏 -->
    <van-nav-bar
      title="外卖卡"
      left-arrow
      @click-left="onClickLeft"
      />

    <!-- table标签页 -->
    <van-tabs v-model:active="active">

      <van-tab>
        <template #title>
          <div class="code">码</div>
          <div>会员码</div>
        </template>
        <template #default>
            <!-- 二维码 -->
            <div class="item_code">
              <QrCode :value="1231231231231" />
              <div class="text">本会会员码定时更新， 请勿截图， 以免影响正常使用</div>
            </div>
            <!-- 去支付横条 -->
            <div class="goPay">
                <div class="line" />
                <div class="goPay-text">去支付</div>
                <div class="line"></div>
            </div>
            <!-- 使用微信支付 -->
            <div class="wx-pay">
              <van-image width="110" height="110" :src="require('../../assets/images/wx-pay.png')" />
              <div class="wx-pay">使用微信支付</div>
            </div>
        </template>
      </van-tab>

      <van-tab>
        <template #title>
          <div class="code">券</div>
          <div>15张</div>
        </template>
        <template #default>
          <van-tabs class="tab2">
            <van-tab title="到店 4">
              <template #default>
                <Coupon />
                <Coupon />
                <Coupon />
              </template>
            </van-tab>
            <van-tab title="外送 4">
              <template #default>
                <Coupon />
              </template>
            </van-tab>
            <van-tab title="百胜会 7">
              <template #default>
                <Coupon />
                <Coupon />
                <Coupon />
                <Coupon />
              </template>
            </van-tab>
          </van-tabs>
        </template>
      </van-tab>

      <van-tab>
        <template #title>
          <div class="code">权益</div>
          <div>0张</div>
        </template>
        <template #default>
            <div class="equity">
              <van-image :src="require('../../assets/images/order/person.png')"></van-image>
              <div class="text1">哎呀，您还没有更多的权益呢</div>
              <div class="text2">快去购买更多的权益吧</div>
              <van-button icon="plus" type="primary">更多付费会员权益</van-button>
            </div>
        </template>
      </van-tab>

      <van-tab>
        <template #title>
          <div class="code">余额</div>
          <div>充值有礼</div>
        </template>
        <template #default>
          <div class="balance-card">
            <div class="card">
              <div class="text">余额(元)</div>
              <div class="number">99999</div>
              <van-button type="primary" size="normal" >充值</van-button>
              <div class="line"></div>
              <div class="record">
                <van-icon name="shopping-cart-o" />
                <span>冲值记录</span>
              </div>

            </div>
          </div>
        </template>
      </van-tab>

    </van-tabs>

  </div>
</template>

<script setup>
import QrCode from './components/qrCode.vue'
import Coupon from './components/coupon.vue'
const onClickLeft = () => history.back()
</script>

<script>
export default {
  name: 'my-Card'
}
</script>

<style scoped lang="less">
.contain {
    background: #fff;
    height: 500px;
}
/deep/ .van-nav-bar .van-icon {
  color: #5a5a5a;
}
/deep/ .van-tab__text--ellipsis {
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  align-items: center;
  height: 65%;
  .code {
    font-size: 40px;
    color: black;
  }
}
/deep/ .van-tabs{
    height: 160px;
}
/deep/ .van-tabs--line .van-tabs__wrap{
  height: 100%;
}
/deep/ .van-tab--active {
    color: #c4413c;
    .code {
        color: #c4413c;
    }
}
/deep/ .van-tabs__line {
      background: #c4413c;
    }
.item_code {
    padding: 60px 35px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 550px;
    .text {
        font-size: 20px;
        color: #999;
    }
}
.goPay {
    display: flex;
    justify-content: space-around;
    align-items: center;
    .line {
      height: 2px;
      width: 210px;
      background: #e7e7e7;
    }
    .goPay-text {
      font-size: 40px;
    }
}
.wx-pay {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 33px;
    color: #666;
}
.tab2 {
    height: 80px;
    /deep/.van-tabs__line {
      background: #fff;
    }
    /deep/.van-tabs__nav--line {
        width: 60%;
    }
    /deep/.van-tabs__content {
        padding: 5px 10px;
        background: #DFDFDF;
    }
    .van-tab__panel {
        .contain {
            border-radius: 15px;
            margin-top:15px ;
            height: 300px;
        }
    }
    .van-tab__panel {
        margin-top: 25px;
    }
}
.balance-card {
    height: 100vh;
    width: 100%;
    background-color: #f0f0f0;
    padding: 20px 20px;
    .card {
        padding-top:10px ;
        padding-bottom: 10px;
        height: 420px;
        background: #fff;
        border-radius: 30px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        .text {
          font-size: 40px;
          color: #c1c1c1;
        }
        .number {
          height: 80px;
          line-height: 80px;
          font-size: 80px;
          color: #333333;
        }
        .van-button--primary {
            background: #c4413c;
            height: 100px;
            width: 300px;
            border: 0;
            border-radius: 50px;
            .van-button__text {
                font-size: 45px;
                color: #fffffd;
            }
        }
        .line {
          height: 3px;
          width: 550px;
          background: #f0f0f0;
        }
        .record {
            display: flex;
            justify-content: center;
            align-items: center;
            .van-icon {
              font-size: 55px;
              margin-right:15px ;
            }
            color: #666666;
            font-size: 30px;
        }

    }
}
.equity {
  width: 100%;
  height: 100vh;
  background-color: #F5F5F5;
  display: flex;
  flex-direction: column;
  align-items: center;
  .text1 {
    font-size: 40px;
    color: #333333;
  }
  .text2 {
    font-size: 25px;
    color: #999999;
    margin-top: 25px;
    margin-bottom: 35px;
  }
  .van-button--primary {
    height: 80px;
    width: 450px;
    border-radius: 50px;
    background: #c4413c;
    border: 0;
  }
}
</style>
